|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPER.rover.OmniDriveAction
Drives the trikebot a specified distance at a specified angle and speed. This action is different from the DriveToAction in that it uses Omnidirectional steering rather than Ackerman steering. The changes in speed are roughly, but not exactly, linear. Therefor, the rover will drive at the specified speed, but the distance covered will only be approximate and will vary slightly depending on the speed.
Field Summary | |
static byte |
CYCLE_SAFETY
The safety level where it will cycle through multiple safety points |
static byte |
NO_SAFETY
The safety level where no checking is done |
static byte |
STATIC_SAFETY
The safety level where it will keep the head at pan=angle of travel, tilt=-35 |
Constructor Summary | |
OmniDriveAction(int dist,
int ang,
double speed,
int v)
Creates a new OmniDriveAction that does not take pictures and has safety turned off. |
|
OmniDriveAction(int dist,
int ang,
double speed,
int v,
boolean takePics)
Creates a new OmniDriveAction with saftey turned off. |
|
OmniDriveAction(int dist,
int ang,
double speed,
int v,
byte safetyLevel,
boolean takePics)
Creates a new OmniDriveAction with the specified safety level. |
Method Summary | |
boolean |
doAction(Rover r)
Tries to start the action. |
long |
getImageUpdateTime()
Lets you know when the last image was taken. |
java.awt.image.BufferedImage |
getRecentImage()
Gets the most recent image taken by this action. |
int |
getReturnValue()
Returns SUCCESS if the rover drove the entire distance without detecting an obstacle or error. |
java.lang.String |
getShortSummary()
Provides a shortened version of the summary returned by getSummary. |
java.lang.String |
getSummary()
Provides a textual explanation of the Action, such as "turn 90 degrees" |
int |
getTime()
Returns how long the action took to complete the last time it was executed, or how long the action is expected to take if it has never been executed. |
int |
getTimeRemaining()
How much time until the action finishes (in milliseconds), if it has already started. |
boolean |
isCompleted()
Whether the action has completed. |
boolean |
isSuccess()
Returns true if the rover drove the entire distance without detecting an obstacle or error. |
void |
kill()
Emergency stop - end the action immediately, if it's running. |
void |
setAngle(int ang)
Sets the angle to the given degree (0=straight, 90=left, -90=right). |
void |
setDistance(int distance)
Sets the distance to the given cm value and recalculates how long the action will take. |
void |
setSpeed(int s)
Sets the speed to the given percent, where 0 is stopped and 1 is full speed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte NO_SAFETY
public static final byte CYCLE_SAFETY
public static final byte STATIC_SAFETY
Constructor Detail |
public OmniDriveAction(int dist, int ang, double speed, int v)
dist
- centimeters to moveang
- the angle to drive at. The minimum angle is -90 and
the maximum angle is 90. Anything outside this range will be set
to the closest valid value. (0=straight, 90=left, -90=right)speed
- the speed to drive at. Should be between 0 and 1, where 0 is
stopped and 1 is full speed. Anything less than 0 will be treated as 0.
Anything greater than 1 will be treated as 1.public OmniDriveAction(int dist, int ang, double speed, int v, boolean takePics)
dist
- centimeters to moveang
- the angle to drive at. The minimum angle is -90 and
the maximum angle is 90. Anything outside this range will be set
to the closest valid value. (0=straight, 90=left, -90=right)speed
- the speed to drive at. Should be between 0 and 1, where 0 is
stopped and 1 is full speed. Anything less than 0 will be treated as 0.
Anything greater than 1 will be treated as 1.takePics
- if true, the rover will take pictures as it drivesgetRecentImage()
,
getImageUpdateTime()
public OmniDriveAction(int dist, int ang, double speed, int v, byte safetyLevel, boolean takePics)
dist
- centimeters to moveang
- the angle to drive at. The minimum angle is -90 and
the maximum angle is 90. Anything outside this range will be set
to the closest valid value. (0=straight, 90=left, -90=right)speed
- the speed to drive at. Should be between 0 and 1, where 0 is
stopped and 1 is full speed. Anything less than 0 will be treated as 0.
Anything greater than 1 will be treated as 1.safetyLevel
- CYCLE_SAFETY, STATIC_SAFETY, or NO_SAFETYtakePics
- if true, the rover will take pictures as it drivesgetRecentImage()
,
getImageUpdateTime()
Method Detail |
public void setDistance(int distance)
public void setAngle(int ang)
public void setSpeed(int s)
public boolean doAction(Rover r)
Action
doAction
in interface Action
public int getTime()
getTime
in interface Action
public java.lang.String getSummary()
Action
getSummary
in interface Action
public java.lang.String getShortSummary()
Action
getShortSummary
in interface Action
public int getReturnValue()
getReturnValue
in interface Action
RoverState
public boolean isSuccess()
isSuccess
in interface Action
public java.awt.image.BufferedImage getRecentImage()
public long getImageUpdateTime()
public boolean isCompleted()
isCompleted
in interface Action
public void kill()
kill
in interface Action
public int getTimeRemaining()
getTimeRemaining
in interface Action
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |